<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册页面</title>
<script type="text/javascript" src="${cxt }/js/jquery-3.2.1.js"></script>
<link href="${cxt }/css/yk_reg.css" rel="stylesheet" type="text/css" />
<link href="${cxt }/css/yk_base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${cxt }/js/yk_reg.js" ></script>
<script type="text/javascript">
		
		function reg(){
			var msg ="";
			if($("input[name=xname]").val()==null||$("input[name=xname]").val()==""){
				msg = $("#namecheck");
				msg.text("请输入姓名！");
				$("input[name=xname]").focus();
				return;
			}else{
				msg = $("#namecheck");
				msg.text("");
			}
			
			if($("input[name=card]").val()==null||$("input[name=card]").val()==""){
				msg = $("#cardcheck");
				msg.text("请输入身份证号码！");
				$("input[name=card]").focus();
				return;
			}else{
				msg = $("input[name=card]");
				if(msg.val().length<18 || msg.val().length>18){
					msg = $("#cardcheck");
					msg.text("身份证位数不对");
					$("input[name=card]").focus();
					return;
				}else{
					msg = $("#cardcheck");
					msg.text("");	
				}
			}
			
			
			if($("input[name=telnum]").val()==null||$("input[name=telnum]").val()==""){
				msg = $("#phonecheck");
				msg.text("请输入手机号码！");
				$("input[name=telnum]").focus();
				return;
			}else{
				msg= $("input[name=telnum]");
				if(msg.val().length<11||msg.val().length>11){
					msg = $("#phonecheck");
					msg.text("请输入正确的手机号码！");
					$("input[name=telnum]").focus();
					return;
				}else{
					msg = $("#phonecheck");
					msg.text("");
				}
			}
			
			if($("input[name=tel]").val()==null||$("input[name=tel]").val()==""){
				msg = $("#numcheck");
				msg.text("请输入验证码！");
				$("input[name=tel]").focus();
				return;
			}else if($("input[name=tel]").val()!=$("input[name=num]").val()){
				msg = $("#numcheck");
				msg.text("验证码错误，请重新输入！");
				$("input[name=tel]").focus();
				return;
			}else{
				msg = $("#numcheck");
				msg.text("");
			}
			
			if($("input[name=pwd]").val()==null||$("input[name=pwd]").val()==""){
				msg =$("#pwdcheck");
				msg.text("请输入密码！");
				$("input[name=pwd]").focus();
				return;
			}else{
				msg = $("input[name=pwd]");
				if(msg.val().length<6){
					msg =$("#pwdcheck");
					msg.text("密码过短！");
					$("input[name=pwd]").focus();
					return;
				}else{
					msg =$("#pwdcheck");
					msg.text("");
				}
			}
			
			if($("input[name=paypwd]").val()==null||$("input[name=paypwd]").val()==""){
				msg =$("#paycheck");
				msg.text("请设置支付密码！");
				$("input[name=paypwd]").focus();
				return;
			}else{
				msg = $("input[name=paypwd]");
				if(msg.val().length<6){
					msg =$("#paycheck");
					msg.text("密码过短！");
					$("input[name=paypwd]").focus();
					return;
				}else{
					msg =$("#paycheck");
					msg.text("");
				}
			}
			
			//脚本验证成功之后，提交表单
			$("#myform").submit();
		}
		//ajax获取验证码
			function getYZM(){
				$.ajax({
					type:"get",
					url:"yzm",
					data:"num="+$("#tel").val(),
					success:function(e){
						//重新设置验证码
						$("#num").val(e);
						$("input[name=yzm1]").val(e);
					}
				});
			}
</script>
</head>
<body style="background-color: #F2F3F5;">
	<div style="width: 100%;background-color: black;">
			<div class="head">
				<a class="head_bd_logo" href="javascript:void(0)" alt="神州租车">
				</a>
				<span class="head_bd_zi">欢迎注册</span>
					<div class="head_tel pointer" id="telp"></div>
					<a class="tel_pp" id="telpp"></a>
			</div>
		</div>
		<div style="width: 100%;">
			<div class="main">
				<div class="reg1">
					<p class="zuche">注册新用户</p>
					<form id="myform" name="myform" method="post" action="reg">
						<ul>
							<li>
								<span class="rstar">*</span>
								<span class="tu user"></span>
								<input type="text" name="xname" id="xname" placeholder="请输入您的真实姓名" class="shuru"/>
								<span class="error" id="namecheck">${msg }</span>
							</li>
							<li>
								<span class="rstar">*</span>
								<span class="tu card"></span>
								<input type="text" name="card" id="card" placeholder="请输入您的身份证号码" class="shuru"/>
								<span class="error" id="cardcheck">${msg }</span>
							</li>
							<li>
								<span class="rstar">*</span>
								<span class="tu phone"></span>
								<input type="text" name="telnum" id="telnum" placeholder="请输入您的手机号" class="shuru"/>
								<span class="error" id="phonecheck">${msg }</span>
							</li>
							<li>
								<span class="rstar">*</span>
								<span class="tu email"></span>
								<input type="text" name="tel" id="tel" placeholder="请输入验证码"  class="tel"/>
								<input type="button" name="num" id="num" value="${yzm}" class="telnum pointer" onclick="getYZM()"/>
								<input type="hidden" name="yzm1" value="${yzm }">
								<span class="error" id="numcheck">${msg }</span>
							</li>
							
							<li>
								<span class="rstar">*</span>
								<span class="tu pwd"></span>
								<input type="password" name="pwd" id="pwd" placeholder="建议6-18位数字、字母、符号的组合" class="shuru"/>
								<span class="error" id="pwdcheck">${msg }</span>
							</li>
							<li>
								<span class="rstar">*</span>
								<span class="tu paypwd"></span>
								<input type="password" name="paypwd" id="paypwd" placeholder="请设置支付密码" class="shuru"/>
								<span class="error" id="paycheck">${msg }</span>
							</li>
						</ul>
						<p >
						<input type="checkbox" checked="checked"/>
						<span>我已阅读并同意</span>
						<a href="javascript:void(0)" target="_blank" class="clause">《神州租车会员服务条款》</a>
					</p>
					<input type="button" name="register" value="注册" class="register pointer" onclick="reg()"/>
					</form>
				</div>
				<div class="reg2">
					<span>已有账号？</span><a href="login" class="clause" target="_top">立即登录>></a>
					<div>
						<img src="img/yk_huodong.png" class="qcode"/>
					</div>
				</div>
			</div>
		</div>
		<div style="width: 100%;background-color: white;">
			<div class="brand">
				<ul>
					<li>
						<img src="img/yk_chexing.png" />
						<p>100+车型</p>
					</li>
					<li>
						<img src="img/yk_wangdian.png" style="padding-left: 20px;"/>
						<p>1000+网点</p>
					</li>
					<li>
						<img src="img/yk_chexian.png" style="padding-left: 20px;"/>
						<p>100%车险</p>
					</li>
					<li>
						<img src="img/yk_licheng.png" />
						<p>无限里程</p>
					</li>
				</ul>
			</div>
			<div class="footmenu">
					<dl class="wyd">
						<dt>租车预定说明</dt>
						<dd>
							<a href="javascript:void(0)" target="_blank" >服务时间</a>
							<a href="javascript:void(0)" target="_blank">待租车况</a>
							<a href="javascript:void(0)" target="_blank">服务预定</a>
							<a href="javascript:void(0)" target="_blank">短租产品</a>
							<a href="javascript:void(0)" target="_blank">租车资格</a>
							<a href="javascript:void(0)" target="_blank">取还车说明</a>	
						</dd>
					</dl>
					<dl class="why">
						<dt>会员管理</dt>
						<dd>
							<a href="javascript:void(0)" target="_blank" >会员章程</a>
							<a href="javascript:void(0)" target="_blank" >会员细则</a>
							<a href="javascript:void(0)" target="_blank" >定级积分</a>
						</dd>
					</dl>
					<dl class="wsj">
						<dt>紧急事务处理</dt>
						<dd>
							<a href="javascript:void(0)" target="_blank" >保险责任</a>
							<a href="javascript:void(0)" target="_blank" >理赔说明</a>
							<a href="javascript:void(0)" target="_blank" >事故处理</a>
							<a href="javascript:void(0)" target="_blank" >救援及备用车</a>
						</dd>
					</dl>
					<dl class="wfy">
						<dt>租车费用及结算</dt>
						<dd>
							<a href="javascript:void(0)" target="_blank" >价格说明</a>
							<a href="javascript:void(0)" target="_blank" >结算流程</a>
							<a href="javascript:void(0)" target="_blank" >储值卡</a>
							<a href="javascript:void(0)" target="_blank" >积分</a>
						</dd>
					</dl>
					<dl class="wbz">
						<dt>帮助中心</dt>
						<dd>
							<a href="javascript:void(0)" target="_blank" >常见问题</a>
							<a href="javascript:void(0)" target="_blank" >新手上路</a>
							<a href="javascript:void(0)" target="_blank" >服务规则</a>
						</dd>
					</dl>
			</div>
			<div class="zc_main">
				<div class="zit">
					<a href="javascript:void(0)" style="margin-left: 0px;">关于我们</a>
					<a href="javascript:void(0)">投资者关系</a>
					<a href="javascript:void(0)">新闻中心</a>
					<a href="javascript:void(0)">加盟合作</a>
					<a href="javascript:void(0)">隐式保护</a>
					<a href="javascript:void(0)">网站导航</a>
					<a href="javascript:void(0)">联系我们</a>
					<a href="javascript:void(0)">招贤纳士</a>
					<a href="javascript:void(0)" style="margin-left: 407px;margin-right: 0px;">English>></a>
				</div>
				<div class="copyright">
					<span>Copyright@2008-2018 www.zuche.com All Rights Reserved. 北京神州汽车租赁有限公司 京ICP备10005002号 京公网安备号 11010502026705</span>
					<span style="margin-left: 34px;">如果您对神州租车网站有任何意见，欢迎发送邮件到 <a href="javascript:void(0)">web@zuche.com</a> </span>
				</div>
				<div class="tupian">
					<img src="img/yk_kexin.png" />
					<img src="img/yk_chengxin.png" />
				</div>
			</div>
		</div>
</body>
</html>